home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / c01lab1.zip / ADAWKBK / SOL1-1.ADA next >
Text File  |  1992-11-11  |  752b  |  30 lines

  1. -- Problem 1.1
  2. -- by Rick Conn
  3. with Text_IO;  -- context specification
  4.  
  5. procedure Count_Down is  -- an Ada mainline is always a procedure
  6.  
  7.   Number_of_Iterations : Integer := 1;
  8.     -- local variable definition
  9.  
  10.   package Int_IO is new Text_IO.Integer_IO (Integer);
  11.     -- local package for Integer I/O
  12.  
  13. begin -- Count_Down
  14.  
  15.   Text_IO.Put ("Enter number of iterations: ");
  16.   Int_IO.Get (Number_of_Iterations);
  17.   Text_IO.New_Line;
  18.  
  19.   Text_IO.Put ("The loop will run for ");
  20.   Int_IO.Put (Number_of_Iterations);
  21.   Text_IO.Put_Line (" iterations");
  22.  
  23.   for Index in 1 .. Number_of_Iterations loop
  24.     Text_IO.Put ("Iteration: ");
  25.     Int_IO.Put (Index, 4);  -- 4 column field
  26.     Text_IO.New_Line;
  27.   end loop;
  28.  
  29. end Count_Down;
  30.